home *** CD-ROM | disk | FTP | other *** search
/ Tiger Disk 5 / Tiger_Disk_005_19xx_Tiger-Crew-Disk_de_Side_B.d64 / 3d_4 gewinnt[pl] (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  6KB  |  163 lines

  1. 0 l=1:dim fa(200),f(20),g(40):x$="":gosub4500
  2. 1 print"[147]":p(1)=0:p(2)=14:restore
  3. 4 print"":fort=1to125:fa(t)=0:nextt
  4. 6 print""
  5. 7 print"";chr$(142)
  6. 8 print""
  7. 9 print""
  8. 10 print" [164][164]     [164][164]     [164][164]     [164][164]     [164][164]    "
  9. 11 print" [205] [205]    [205] [205]    [205] [205]    [205] [205]    [205] [205]"
  10. 12 print"  [205] [205]    [205] [205]    [205] [205]    [205] [205]    [205] [205]"
  11. 13 print"   [205] [205]    [205] [205]    [205] [205]    [205] [205]    [205] [205]"
  12. 14 print"    [205] [205]    [205] [205]    [205] [205]    [205] [205]    [205] [205]"
  13. 15 print"     [205] [205]    [205] [205]    [205] [205]    [205] [205]    [205] [205]"
  14. 16 print"      [163][163]     [163][163]     [163][163]     [163][163]     [163][163]":ifgh=1thenreturn
  15. 17 poke198,0:printx$"spieler"l"ist dran.":poke53280,254
  16. 18 print"ihr zug (tiefe,breite):"
  17. 19 input t,b
  18. 22 gosub100:if t<1ort>5 then print"[145][145]":goto19
  19. 23 if b<1orb>5 then print"[145][145]":goto19
  20. 24 if h<1orh>5 then print"[145][145]":goto19
  21. 25 xy=(t*5-5)+b+(h*25-25):iffa(xy)<>0then print"[145][145]":goto19
  22. 30 if xy>25thenjhg=0:iffa(xy-25)=0then print"[145][145]":goto19
  23. 32 q=(1470-t*41)+41+b*7-7-h*40+40
  24. 40 poke q-41,79:fa(xy)=l:pokeq-41+54272,p(l)
  25. 41 iffa(xy+20)<>0thengoto 44
  26. 42 iffa(xy+15)<>0thenpokeq-40,119:pokeq,79:goto 46
  27. 43 poke q-39,77:pokeq-40,119:pokeq+54272-39,p(l):pokeq+54272-40,p(l)
  28. 44 ifxy>5thenjhg=0:iffa(xy-5)<>0then goto 46
  29. 45 poke q,79:poke q+1,80:pokeq+54272,p(l):pokeq+54273,p(l)
  30. 46 if xy>25then poke q-1,116
  31. 47 if gh=1thenreturn
  32. 50 poke53265,0
  33. 51 for t=1to 13:kl=1
  34. 52 read f(t):nextt:fort=1to13:poke53280,int(16*rnd(1))+1
  35. 53 kl=0:if xy<f(t) then goto 55
  36. 54 if fa(xy-f(t))=lthen y=f(t):gosub 900
  37. 55 if fa(xy+f(t))=lthen y=f(t):gosub 900
  38. 56 ifkl=1thenforvb=1to20:read aq:nextvb:kl=.
  39. 57 next t:l=l+1:ifl=3thenl=1
  40. 58 poke53265,27
  41. 59 restore:print"[145][145][145][145]":goto17
  42. 100 xy=t*5-5+b
  43. 101 if fa(xy)=0thenh=1:return
  44. 102 if fa(xy+25)=0thenh=2:return
  45. 103 if fa(xy+50)=0thenh=3:return
  46. 104 if fa(xy+75)=0thenh=4:return
  47. 105 if fa(xy+100)=0thenh=5:return
  48. 106 h=6:return
  49. 900 kl=.:forr=1to20:readg(r)
  50. 903 forhy=-100to100 step 25
  51. 904 if xy-y=g(r)+hythenifxy-2*y=g(r)+hythenifxy-3*y=g(r)+hythen za=1
  52. 910 if xy-y=g(r)+hythenifxy+y=g(r)+hythenifxy-2*y=g(r)+hythen zb=1
  53. 920 if xy-y=g(r)+hythenifxy+y=g(r)+hythenifxy+2*y=g(r)+hythen zc=1
  54. 930 if xy+y=g(r)+hythenifxy+3*y=g(r)+hythenifxy+2*y=g(r)+hythen zc=1
  55. 939 nexthy:nextr
  56. 941 if za=1andzb=1andzc=1andzd=1thenreturn
  57. 998 poke53265,27
  58. 999 if za=1thenza=0:goto1008
  59. 1000 if xy-2*y<1orxy-3*y<1then goto1009
  60. 1002 if fa(xy-y)=l and fa(xy-2*y)=l and fa(xy-3*y)=lthen print"spieler"l:end
  61. 1008 if zb=1thenzb=0:goto1011
  62. 1009 if xy+y>125orxy-2*y<1then goto1012
  63. 1010 if fa(xy-y)=land fa(xy+y)=land fa(xy-2*y)=lthen print"spieler"l:end
  64. 1011 if zc=1thenzc=0:goto1015
  65. 1012 if xy+y>125orxy+2*y>125orxy-y<1then 1015
  66. 1013 if fa(xy-y)=landfa(xy+y)=landfa(xy+2*y)=lthen print"spieler"l:end
  67. 1014 if xy+y>125orxy+2*y>125orxy+3*y>125 then return
  68. 1015 if zd=1thenzd=0:goto1020
  69. 1016 if fa(xy+y)=landfa(xy+2*y)=landfa(xy+3*y)=lthen print"spieler"l:end
  70. 1020 return
  71. 2000 data 31,30,29,26,25,24,21,20,19,6,5,4,1
  72. 2100 data 1,2,3,4,5,6,11,16,21,22,23,24,25,20,15,10,0,0,0,0
  73. 2110 data 1,2,3,4,5,21,22,23,24,25,0,0,0,0,0,0,0,0,0,0
  74. 2120 data 1,2,3,4,5,6,11,16,21,22,23,24,25,20,15,10,0,0,0,0
  75. 2130 data 21,16,11,6,1,25,20,15,10,5,0,0,0,0,0,0,0,0,0,0
  76. 2140 data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  77. 2150 data 21,16,11,6,1,25,20,15,10,5,0,0,0,0,0,0,0,0,0,0
  78. 2160 data 1,2,3,4,5,6,11,16,21,22,23,24,25,20,15,10,0,0,0,0
  79. 2170 data 21,22,23,24,25,1,2,3,4,5,0,0,0,0,0,0,0,0,0,0
  80. 2180 data 1,2,3,4,5,6,11,16,21,22,23,24,25,20,15,10,0,0,0,0
  81. 2190 data 1,2,3,4,5,6,11,16,21,22,23,24,25,20,15,10,0,0,0,0
  82. 2200 data 1,2,3,4,5,6,11,16,21,22,23,24,25,20,15,10,0,0,0,0
  83. 2210 data 1,2,3,4,5,6,11,16,21,22,23,24,25,20,15,10,0,0,0,0
  84. 2220 data 1,2,3,4,5,6,11,16,21,22,23,24,25,20,15,10,0,0,0,0
  85. 4500 print"[147]  (a[146])nleintung"
  86. 4501 print"  (s[146])piel"
  87. 4502 gett$:ift$="a"then5000
  88. 4503 ift$="s"thenreturn
  89. 4504 goto4502
  90. 5000 print"[147] [202]eder kennt doch das gewoehnliche";chr$(14)
  91. 5001 print" 4-[199]ewinnt. [196]a mir das zu oede war,"
  92. 5002 print" entschloss ich mich, etwas neues zu"
  93. 5003 print" programmieren....."
  94. 5004 fort=1to5000:nextt
  95. 5005 print"[147]    [221][160][160][160]"
  96. 5006 print"    [221]   "
  97. 5007 print"    [221] [221] "
  98. 5008 print"    [173][192][219][192]"
  99. 5009 print"      [221]  [154][199]ewinnt ....."
  100. 5010 print"      [177] "
  101. 5011 print"     ":fort=1to2000:nextt
  102. 5012 print"               [192][192][192][174]"
  103. 5013 print"                  [221]"
  104. 5014 print"                [192][192][179]"
  105. 5015 print"                  [221]"
  106. 5020 print"  [154] ...... in   [192][192][192][189] [154]  [196]imensionen."
  107. 5025 for t=1to3000:nextt
  108. 5026 print"[147] [196]ie [210]egeln sind dieselben wie bei"
  109. 5027 print" dem gewoehnlichem 4-[199]ewinnt. [196]er [213]nter-"
  110. 5028 print" schied ist, dass man [211]teine nicht nur"
  111. 5029 print" nebeneinander, sondern auch aufeinander"
  112. 5030 print" setzen kann."
  113. 5031 print" [197]in [211]pieler gewinnt, wenn er 4 [211]teine"
  114. 5032 print" in einer [210]eihe setzen konnte."
  115. 5033 print" [194]eispiel kommt ([211]pace druecken)"
  116. 5035 gett$:ift$<>" "then5035
  117. 5036 printchr$(142):gh=1:gosub 1
  118. 5037 t=1:b=1:l=1:gosub22:t=1:b=1:l=2:gosub22:l=1:t=2:b=2:gosub22
  119. 5038 l=2:t=2:b=2:gosub22:b=3:t=3:l=1:gosub22:l=2:gosub22:b=4:t=4:l=1:gosub22
  120. 5039 print"  dieses spiel gewinnt spieler 1"
  121. 5040 print"  (schwarz). der computer schreibt dann"
  122. 5041 print"  'spieler 1'. schlicht aber wir-"
  123. 5042 print"  kungsvoll....."
  124. 5050 print" space druecken fuer weitere beispiele."
  125. 5051 gett$:ift$<>" "then5051
  126. 5052 gosub1
  127. 5053 t=5:b=5:l=2:gosub22:l=2:gosub22:l=2:gosub22:l=1:gosub22
  128. 5054 t=4:b=4:l=2:gosub22:gosub22:l=1:gosub22
  129. 5055 t=3:b=3:l=2:gosub22:l=1:gosub22
  130. 5056 t=2:b=2:l=1:gosub22
  131. 5060 gh=0:print" auch hier gewinnt spieler 1. ich denke,";
  132. 5061 print" diese beiden beispiele haben die "
  133. 5062 print" arbeitsweise dieses programmes klar-"
  134. 5063 print" gemacht."
  135. 5070 print" space druecken."
  136. 5071 gett$:ift$<>" "then5071
  137. 5080 print"[147] [202]etzt noch etwas zur [197]ingabe eines";chr$(14)
  138. 5081 print" [218]uges: [196]er [195]omputer erwartet bei der"
  139. 5082 print" [197]ingabe 2 '[203]oordinaten': [193]ls erstes"
  140. 5083 print" muss die [212]iefe eingegeben werden."
  141. 5084 print" [212]iefe besagt, ob der [211]tein weit"
  142. 5085 print" vorne (1) oder weit hinten (5) gesetzt"
  143. 5086 print" wird. [194]reite sagt dem [195]omputer, ob der"
  144. 5087 print" [211]tein ganz links (1) oder ganz rechts"
  145. 5088 print" (5) gesetzt wird."
  146. 5089 print" [211]pace druecken."
  147. 5090 gett$:ift$<>" "then5090
  148. 5100 print"[147] [200]ier die [203]oordinaten aller 4 [197]cken:"
  149. 5101 print"  [204]inks, vorne (unten)  =  1 , 1"
  150. 5103 print"  [204]inks, hinten (oben)  =  5 , 1"
  151. 5104 print"  [210]echts, vorne (unten) =  1 , 5"
  152. 5105 print"  [210]echts, hinten (oben) =  5 , 5"
  153. 5106 print" [196]ie beiden [203]oordinaten werden mit"
  154. 5107 print" einem [203]omma dazwischen eingegeben."
  155. 5108 print" [194]eispiele: 1,1 oder 2,3 oder 4,1 usw."
  156. 5109 print" [211]pace[146] druecken."
  157. 5110 gett$:ift$<>" "then5110
  158. 5120 printchr$(14):print"[147]       [201]ch wuensche euch noch"
  159. 5121 print"     viel [211]pass mit dem [211]piel[160]!"
  160. 5130 print"        [208]hantom [204]ord[154] of [212]-[195][154]."
  161. 5150 fort=1to4000:nextt
  162. 5160 return
  163.